package cn.kgc.util;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id ="2016092700609549";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWxLXtLPNlwRBkqs7lop0Ihl+jTAZhlqSaRd8tuciuTA7ofGaySpEDQ+a4amtCYgpSRaOha5TVBcd3uxUi8EksVnTNqsTxF+UHXdCfyIxqOqCQcuNu7L+cJtbDw+6nxp4CQpokPJeVOtF/eMFt1KqtjtOT8zMSw8UQzKaaonj1ik1awGpXT1pl3hOVjXriGq7RabBhKjPOGNoxF/2zb7ToIsNiBG/6eeYRKonuGpT7udOeoIXfiNoSafAAnPA+P1oVFM57QGZEib+H3Z62YP4MCEjoo0WbKJHiQsZbGDt873gKKEWwuCIOkTetxIUA8YFvFtRc9umJCTLv0jDnATlhAgMBAAECggEABzZLuZe/4Os2XIprMULxHhpHculNGNf68cJL5cUQW34Z7Hce9oJoo25ZGBNHJDrKYZshM7SQvwvyucCCR1SVO4C7P6demmXZN9v+Ada3GNHLIn3McV7z34VgGqdBwFbY8iS7eOZJHgNdSCq/ngBhVcISTu6AT/J7d81CXv1Mqfor3ARZxWvXq75T6M6sSuAQr2rwAOAkyDiRUSPQb3QmPbxyOPh7dlRpfIqf5HVBoM9GagU5b4fTpaYUimVxoO3nI1Yf1BJwZs4mwrfgnNwiNSjvFJxRliJYRAyIPRy91S5a+NaH+mZrkvQ9wenMLFRDMX6C90NB6wjxBIN43z3E/QKBgQDPoMdDUoGBSr1hTR3J4rSRrSqkJfuADwpKrwOuy8PjQO4/9YSPlp4+PcMUNSa205Ox7l/mRimvZ7IKMpTFQBvvccRLbN7ptQGGkI4JmSj06LpAcbaeLz25xLnJGl+qjShgnDfVehDiKuBDnsiM+b78WknkW1lBikY3bH5svzwdlwKBgQC55L7Io9M64p65YFCSP8xi65sf2DM4qCn0N5iMX0De+Q174I+FB4MnDcfx6ykaK6sNvVjrpLNshs+QMAYK87lrBtXD9XP8AotHgw72otVOCKwqeMUddonh9sOD2vnQ4beQWaWShAiB1s3iU3NYyIeQxz+2SsOH9gkffMEoStSvxwKBgQCUZA1mETabqEYXn5z1qABzyTaboMXR7W3mmJTiPaGf7s0YiymV0gkA5PVioOYtbqO1XG/PzT+HrG3zmdj37OzKQh4P5hyfHY2clf3d4EgEWbybyGnDPnI4LeC2WRIce8xq19uTyCz+57PmwDoHf4s/ImyDN8Jf9Cpg/DqTEE4vuwKBgHdQKmP9QoZ5DgdNmmlEKZsUPeyih73FsafeRztRqAF1OQJZj8SCndtjLQJJPYhentuivIACpmbx4Cdbq4U8CbZ4HJw53sfRmjO8Gs6SlPYQ+vAHs/zFKJqwF615zv4S4g70eyEfPZaYmGy7wz0o+FokiPAn7HhHonNjT1bdMMXhAoGAXYPtJuiWal3L+UaM4KiAbBBQAQ3/JzZQfLDNacSIM3DSZ3w1TZdR4g2g8d2nkwXsqYFDbcK37GA6+sNIA4tJMJT2ZQezSFGmD7xOOAhiYm7uuTkvnOAb0vfqfO8DGxsDO8hNW+p5hVkMbNbovqS4kDocHHTz14kEzN01xT4PHEE=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4xjS/g/0H7pcdCrbLIKFih0+6RjBsN3bujlSnnfejIkHQBiBvOREBisjgWf03QeFJeoz5gjCM08zQCYU4XYLeNZy+9mfXEz8oECe5dmmC3VGL/UmBtEM5WEGDh7Fvi4WXtQthIBEr+Xj1//O9gX+ai8WJQ05m5M8jjz4kQn2rempD+Q2J8u7NH9LmvxTDGsnMY/16dBaUpmW4to5zRIGV6pJeMTuUK7LXfNzU/riZ1BhsCTyg3Z8zVWN2WAq3LcI2GCwis1rHbZKUod8HnqVxAsXS3gLwayi0Eg2iWfRM9AVimL8b/NwsdLIkcOnRXQSWCN1/sYgbSK2VTJs7vIFuQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:80/notify.do";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8082/return.do";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
